<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?>

<!-- 模拟Word文档内容区 -->
<div class="a4-content p-8 md:p-12 relative">
    <!-- 文章标题 -->
    <div class="text-center mb-8 mt-8">
        <h1 class="text-size-2 font-songti font-semibold"><?php $this->title(); ?></h1>
        
        <!-- 文章元数据 -->
        <div class="mt-4 text-gray-500 font-fangSong text-size-4">
            <span><?php $this->author(); ?></span>
            <span class="mx-2">|</span>
            <span><?php $this->date('Y年m月d日'); ?></span>
        </div>
    </div>
    
    <!-- 文章正文 -->
    <article class="word-content font-fangSong text-size-3 leading-relaxed mb-8">
        <!-- 主送机关名称 -->
        <div class="mb-6">
            <?php if ($this->categories): ?>
            <div class="font-fangSong text-size-3">
                <?php $this->category(' 、 '); ?>
            </div>
            <?php endif; ?>
        </div>
        
        <!-- 文章内容 -->
        <div class="word-document-content <?php 
            if ($this->options->heading_style == 'default') {
                echo 'word-headings-default';
            } elseif ($this->options->heading_style == 'all-bold') {
                echo 'word-headings-bold';
            } else {
                echo 'word-headings-same';
            }
        ?>">
            <?php $this->content(); ?>
        </div>
        
        <!-- 附件部分 -->
        <?php if ($this->tags): ?>
        <div class="mt-8">
            <div class="font-fangSong ml-8 text-size-3">
                <span class="font-fangSong">附件：</span>
                <div class="ml-8">
                    <?php $tagCount = 0; ?>
                    <?php $this->tags('', true, function($that, $name, $permalink) use (&$tagCount) { 
                        $tagCount++;
                        echo '<div class="mt-1">'.$tagCount.'. <a href="'.$permalink.'">'.$name.'</a></div>';
                    }); ?>
                </div>
            </div>
        </div>
        <?php endif; ?>
    </article>
    
    <!-- 上一篇/下一篇导航 -->
    <div class="flex justify-between mt-8 border-t border-gray-200 pt-4">
        <div class="flex w-full justify-between">
            <!-- 上一篇 -->
            <div>
                <?php $this->thePrev('<span>&lt;</span> %s', ''); ?>
            </div>
            
            <!-- 下一篇 -->
            <div>
                <?php $this->theNext('%s <span>&gt;</span>', ''); ?>
            </div>
        </div>
    </div>
    
    <!-- 评论区 -->
    <?php if ($this->allow('comment')): ?>
    <div class="mt-8">
        <h3 class="text-lg font-songti mb-4 border-none">留言</h3>
        <?php $this->need('comments.php'); ?>
    </div>
    <?php endif; ?>
</div>

<?php $this->need('footer.php'); ?>